class User{
    // name:string="明凯";
    // age:number=23;
    name:string;
    age:number;
    constructor(name:string="clearlove",age:number=23){
        console.log("User的构造函数");
        this.name=name;
        this.age=age;
    }
    showMsg():void{
        console.log(`name:${this.name};age:${this.age}`);
    }
}
var u1:any=new User();
console.log(u1.name,u1.age);
u1.showMsg();
var u2:User=new User("iboy",20);
console.log(u2.name,u2.age);
u2.showMsg();